//Mindmap v.1.0.0
(function() {
    'use strict';

    angular.module('OE_Styleguide')
        .controller('SgMindmapCtrl', ['$scope', function($scope, $window) {

            $scope.nodes = {
                'a': { id: 'a', childs: ['d'], 'type': 'database', title: 'Database 0', description: 'this is a test of long text another complicated test is required to determin how it will behave this is a test of long text another complicated test is required to determin how it will behave this is a test of long text another complicated test is required to determin how it will behave' },
                'b': { id: 'b', childs: ['d', 'g', 'h', 'i', 'f'], 'type': 'database', title: 'Database 1', description: 'this is a test of long text.' },
                'c': { id: 'c', childs: ['h', 'f', 'i'], 'type': 'database', title: 'Database 2', description: 'this is a test of long text.' },

                'd': { id: 'd', childs: ['f'], parents: ['a', 'b'], 'type': 'cube', title: 'Cube 1', description: 'this is a test of long text.' },
                'e': { id: 'e', childs: ['1a'], parents: ['j'], 'type': 'cube', title: 'Cube 2', description: 'this is a test of long text another complicated test is required to determin how it will behave this is a test of long text another complicated test is required to determin how it will behave this is a test of long text another complicated test is required to determin how it will behave this is a test of long text another complicated test is required to determin how it will behave this is a test of long text another complicated test is required to determin how it will behave this is a test of long text another complicated test is required to determin how it will behave this is a test of long text another complicated test is required to determin how it will behave this is a test of long text another complicated test is required to determin how it will behave' },
                'f': { id: 'f', childs: ['1b'], parents: ['b', 'c', 'd'], 'type': 'cube', title: 'Cube 3', description: 'this is a test of long text another complicated test is required to determin how it will behave' },

                'g': { id: 'g', childs: ['1c'], parents: ['b'], 'type': 'cube', title: 'Cube 4', description: 'this is a test of long text another complicated test is required to determin how it will behave' },
                'h': { id: 'h', 'type': 'cube', parents: ['b', 'c'], title: 'Cube 5', description: 'this is a test of long text another complicated test is required to determin how it will behave' },
                'i': { id: 'i', childs: ['1d'], parents: ['b', 'c'], 'type': 'cube', title: 'Cube 6', description: 'this is a test of long text another complicated test is required to determin how it will behave' },

                'j': { id: 'j', childs: ['e'], 'type': 'cube', title: 'cube but at first level' },

                'k': { id: 'k', 'type': 'cube', title: 'Cube 7', description: 'this is a test of long text another complicated test is required to determin how it will behave' },
                '1a': { id: '1a', childs: ['1c', '1d'], parents: ['e'], 'type': 'cube', title: 'Cube 8', description: 'this is a test of long text another complicated test is required to determin how it will behave' },
                '1b': { id: '1b', childs: ['1d'], parents: ['f'], 'type': 'cube', title: 'Cube 9', description: 'this is a test of long text another complicated test is required to determin how it will behave this is a test of long text another complicated test is required to determin how it will behave' },

                '1c': { id: '1c', childs: ['1d'], parents: ['g', '1a'], 'type': 'cube', title: 'Cube 10', description: 'this is a test of long text another complicated test is required to determin how it will behave' },
                '1d': { id: '1d', 'type': 'output', parents: ['i', '1a', '1b', '1c'], title: 'Output', description: 'this is a test of long text another complicated test is required to determin how it will behave' },
                '1e': { id: '1e', 'type': 'cube', title: 'Loner', description: 'this is a test of long text another complicated test is required to determin how it will behave' },
            };
            
            $scope.config = {
                node: {
                    width: 200,
                    typeConfig: {
                        'database': {
                            class: 'kdx-mindmap-node-example-database', // controls color
                            iconType: 'icon',
                            icon: 'home',
                        },
                        'cube': {
                            iconType: 'icon',
                            icon: 'cube'
                        },
                        'output': {
                            class: 'kdx-mindmap-node-example-output',
                            iconType: 'image',
                            icon: '',
                        }
                    },
                    selectOnLoadId: 14,
                },
                link: {
                    activeClass: 'kdx-mindmap-link-active',
                },
                border: true,
                zoomButton: true,
                iconLinkPath: 'open_emis/js/angular/ngx-adaptor/assets/font-awesome/font-awesome.svg#icon-',
                id: 'exampleMindmap',
            };

            $scope.api = {};

        }]);
})();
